//
//  StatusViewModel.swift
//  SwiftWB
//
//  Created by 远成物流 on 2017/6/28.
//
//

import UIKit

class StatusViewModel: NSObject {
    // MARK:- 定义属性
    var status : Status?
    var cellHeight : CGFloat = 0
    
    // MARK:- 对数据处理的属性
    var sourceText : String?            // 处理来源
    var createAtText : String?          // 处理创建时间
    var verifiedImage : UIImage?        // 处理用户认证图标
    var vipImage : UIImage?             // 处理用户会员等级
    var profileURL : NSURL?             // 处理用户头像的地址
    var picURLs : [NSURL] = [NSURL]()   // 处理微博配图的数据
    
    init(status:Status){
        self.status = status
        
        if let source = status.source , source != "" {
            let startIndex = (source as NSString).range(of: ">").location+1
            let length = (source as NSString).range(of: "</").location-startIndex
            
            sourceText = (source as NSString).substring(with: NSMakeRange(startIndex, length))
        }
        
        if let createAt = status.created_at {

//            createAtText = 
        }
    }
}
